<?php
	class Events_model extends CI_Model{
		function __construct()
			{
				parent::__construct();
			}
	
	
		function getaccout($id, $password){
				$this->db->select("*");
				$this->db->where("TenTaiKhoan",$id);
				$this->db->where("MatKhau",$password);
				$data = $this->db->get("taikhoan");
				return $data->row_array();
			 
		}
		function SuaTK($data){
			$this->db->where("MaTK",$data['MaTK']);
			return $this->db->update('taikhoan', $data); 
		}
		function KiemTraTK($TenTK){
			$this->db->select("*");
			$this->db->where("TenTaiKhoan",$TenTK);
			$data = $this->db->get("taikhoan");
			return  $data->row_array(); 
		}
		function DoiMK($data){
			$this->db->where("MaTK",$data['MaTK']); 
			return $this->db->update('taikhoan', $data); 
		}
		function LayDonDH($TK){
			$this->db->select("*");
			$this->db->where("Ma_TK",$TK); 
			$data = $this->db->get("dondathang");
			return $data->result_array(); 
		}
		 
	}
?>